package com.why.listener;

import com.why.queue.dto.TaskBodyDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class TestListener implements RedisDelayedQueueListener<TaskBodyDTO> {

    Logger logger = LoggerFactory.getLogger(TestListener.class);

    @Override
    public void invoke(TaskBodyDTO taskBodyDTO) {
        // 调用延迟之后的代码
        logger.info("执行....{}==={}", taskBodyDTO.getBody(), taskBodyDTO.getName());
    }
}